package com.study.listener;

import lombok.extern.slf4j.Slf4j;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

/**
 * 自定义 ServletContextListener：基于注解配置
 *
 * @author Administrator
 * @date 2022-08-24
 */
@Slf4j
@WebListener
public class MyServletContextListener implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        log.info("调用了 MyServletContextListener 的 contextInitialized() 方法");
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        log.info("调用了 MyServletContextListener 的 contextDestroyed() 方法");
    }
}
